package com.htrq.util;

import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import org.apache.commons.codec.binary.Base64;

public class Md5cUtil {
	public static String encoderByMd5(String str) throws NoSuchAlgorithmException, UnsupportedEncodingException {
		MessageDigest md5 = MessageDigest.getInstance("MD5");
		String ste = "papa@" + str;
		String newstr = Base64.encodeBase64String(md5.digest(ste.getBytes("utf-8")));
		return newstr;
	}
}
